<!DOCTYPE html>
<html>
    <head>
        <title>html测试</title>
    </head>
    <body>
        <h1>h1标签</h1>
        <p></p>
        <p></p>
        <p></p>
        <p></p>
    </body>
    
    <script type="text/javascript">
        var a = document.getElementsByTagName("p")
        for(var i = 0;i < a.length;++i)
        {
            a[i].innerHTML=i
        }

    </script>
</html>